CREATE TABLE res_org (
  id number(19,0) NOT NULL PRIMARY KEY,
  res_org_id number(19,0),
  active char(1),
  create_by number(19,0),
  create_date timestamp,
  update_by number(19,0),
  update_date timestamp,
  version number(19,0),
  name varchar2(100),
  parent_id number(19,0),
  path varchar2(2000),
  seq_no int,
  code varchar2(100),
  comment2 varchar2(2000),
  org_type varchar2(50)
);

CREATE TABLE res_user(
  id number(19,0) NOT NULL PRIMARY KEY,
  res_org_id number(19,0),
  active char(1),
  create_by number(19,0),
  create_date timestamp,
  update_by number(19,0),
  update_date timestamp,
  version number(19,0),
  username varchar2(50),
  password varchar2(100),
  email varchar2(100),
  phone varchar2(20),
  name varchar2(50),
  comment2 varchar2(2000),
  description varchar2(500),
  phone2 varchar2(20),
  birthday date,
  fax varchar2(50),
  res_partner_id number(19,0),
  sales_rep char(1),
  image blob,
  developer char(1),
  dashboard_page varchar2(100),
  mobile_dashboard_page varchar2(100),
  module_type varchar2(50)
);

CREATE TABLE ir_model
(
    id number(19,0) NOT NULL PRIMARY KEY,
    res_org_id number(19,0),
    active char(1),
    create_by number(19,0),
    create_date timestamp,
    update_by number(19,0),
    update_date timestamp,
    version number(19,0),
    name varchar2(50),
    table_name varchar2(50),
    module_type varchar2(100),
    model_type varchar2(100),
    description varchar2(255),
    json_content clob
);

CREATE SEQUENCE resorg INCREMENT BY 1 START WITH 1  MINVALUE 1 NOCYCLE NOORDER;

CREATE SEQUENCE resuser INCREMENT BY 1 START WITH 1 MINVALUE 1 NOCYCLE NOORDER;

CREATE SEQUENCE irmodel INCREMENT BY 1 START WITH 1 MINVALUE 1 NOCYCLE NOORDER;

insert into res_org(id,active,name,path) values(resorg.nextval,'1','组织机构','1,');

insert into res_user(id,username,password,developer,active,res_org_id) values(resuser.nextval,'admin','$2a$10$7JXIIkJcm1LssXdIkP5JBuQzUt8NXxlGQVyJxTvvAy8E5nz5HGjM.','1','1',1);

